<template>
    <div>
      <el-dialog title="批量发送视频名单" :visible.sync="sendmesageDia" width="514px" center :close-on-click-modal="false">
        <div class="flex_send">
            <i class="el-icon-success" style="color:#22A972;padding-right: 6px;width: 18px;"></i>
             <span>您已勾选:{{videochousedata.length}}个视频，可将勾选视频下方的授权用户，批量发送至邮箱</span> 
        </div>
        <p class="send_title">发送的邮箱地址:</p>
        <el-input placeholder="请输入正确的邮箱地址" v-model="email"></el-input>
        <p class="send_btm">注:如需发送多个邮箱地址，请用英文逗号进行隔开</p>
        <div style="text-align: center;">
            <el-button type="primary" @click="sendEmail()">确定</el-button>
        </div>
        
        </el-dialog> 
    </div>
  </template>
  
  <script>
import indexapi from '@/api/index'
  export default {
   props:{
    videochousedata:Array
   },
    data(){
      return{
        sendmesageDia:false,
        email:'',
        num:0,
        companyData:{}
      }
    },
    mounted(){
      this.companyData=this.$store.getters.companyData
    },
    methods:{
        sendEmail(){
            if (this.$store.getters.companyData.memberType == -1 || this.$store.getters.companyData.memberType == 0) {
                this.$message({type:'error',message:'您还不是会员，开通会员后才可回去数据'})
                return false
            }
            let videoidlist=[]
            this.videochousedata.forEach(item => {
                videoidlist.push(item.videoid)
            });
            let form={
                    company:this.$store.getters.companyData.webinarCompanyName,
                    email:this.email,
                    videoIdList:videoidlist
            }
             indexapi.video.sendEmailByVidoeList(form).then(res=>{
                this.$message({type:'success',message:'发送成功！'})
                this.sendmesageDia=false
                this.$emit('reflash',true)
             })
        }
    }
  }
  </script>
  
  <style lang="scss" scoped>
.flex_send{
    margin-top: 10px;
    margin-bottom: 20px;
    @include flex(row, center, flex-start); 
font-size: 14px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #37474F;
line-height: 16px;
}
.send_title{
font-size: 16px;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #37474F;
line-height: 19px;
margin-bottom: 16px;
}
.send_btm{
    margin-top: 16px;
font-size: 12px;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #A3ADB7;
line-height: 14px;
margin-bottom: 35px;
}
  ::v-deep .el-dialog__header {
    background: #f5f8fc;
    text-align: left;
    font-size: 16px;
    color: #202933;
    padding: 11px 16px;
  }

  
  ::v-deep .el-dialog__body {
    padding: 5px 20px 32px  !important;
  }
  
  ::v-deep .el-dialog__title {
    font-size: 16px;
  }
  ::v-deep .el-input-number:hover{
    border: none;
  }

  </style>